package com.teacherprofile.common.constant;

/**
 * 缓存的key 常量
 *
 * @author ruoyi
 */
public class CacheConstants {
    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 登录账户密码错误次数 redis key
     */
    public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
    /**
     * 业务管理key
     */
    public static final String MANAGE_PREFIX = "manage_";

    /**
     * 模块prefix
     */
    public static final String SOFTWARE_COPY_RIGHT = "software_";
    public static final String PATENTS_COPY_RIGHT = "patents_";
    public static final String TECHNICAL_SERVICES = "technical_services_";
    public static final String REFRESHER_TRAINING = "refresher_training_";

    /**
     * 学术论文key
     */
    public static final String ACADEMIC_PAPERS = "academic_papers_";

    /**
     * 社会兼职key
     */
    public static final String SOCIAL_PARTTIME = "social_parttime_";

    /**
     * 获取权利范围key
     *
     * @return
     */
    public static final String GetRightScopeKey() {
        return concat(MANAGE_PREFIX, SOFTWARE_COPY_RIGHT, "right_scope");
    }


    /**
     * 获取取得方式key
     *
     * @return
     */
    public static final String GetAcquisitionMethodKey() {
        return concat(MANAGE_PREFIX, SOFTWARE_COPY_RIGHT, "acquisition_method");
    }

    private static final String concat(String... args) {
        StringBuilder sb = new StringBuilder();
        for (String arg : args) {
            sb.append(arg);
        }
        return sb.toString();
    }


    public static String GetTypeMethodKey() {
        return concat(MANAGE_PREFIX, PATENTS_COPY_RIGHT, "type");
    }

    /**
     * 获取论文类别key
     *
     * @return
     */
    public static String GetAcademicPapersTypeKey() {
        return concat(MANAGE_PREFIX, ACADEMIC_PAPERS, "type");
    }

    /**
     * 获取论文收录情况key
     *
     * @return
     */
    public static String GetAcademicPapersInclusionKey() {
        return concat(MANAGE_PREFIX, ACADEMIC_PAPERS, "inclusion");
    }

    public static String GetSocialParttimeUnitNatureKey() {
        return concat(MANAGE_PREFIX, SOCIAL_PARTTIME, "unit_nature");
    }

    /**
     * 课题项目管理类型
     *
     * @return
     */
    public static String GetTechnicalServicesKey() {
        return concat(MANAGE_PREFIX, TECHNICAL_SERVICES, "type");
    }


    /**
     * 进修培训
     */
    public interface RefresherTraining {
        /**
         * 进修培训方式
         */
        String METHOD = concat(MANAGE_PREFIX,REFRESHER_TRAINING, "method");
        /**
         * 教研室类型
         */
        String OFFICE_TYPE = concat(MANAGE_PREFIX,REFRESHER_TRAINING, "office_type");
        /**
         * 进修培训类型
         */
        String TYPE = concat(MANAGE_PREFIX,REFRESHER_TRAINING, "type");
        /**
         * 进修培训渠道
         */
        String  CHANNEL = concat(MANAGE_PREFIX,REFRESHER_TRAINING,"channel");
        /**
         * 进修培训考核方式
         */
        String ASSESSMENT_METHOD = concat(MANAGE_PREFIX,REFRESHER_TRAINING,"assessment_method");
        /**
         * 进修培训成果
         */
        String ACHIEVEMENTS = concat(MANAGE_PREFIX,REFRESHER_TRAINING,"achievements");
    }

}
